<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="Order.OrderDeal"%>
<script  language="javascript">
<!-- Begin validation script  
function checkForm(){
	    if(document.form1.OrderNum.value==""){
		alert("请输入购买商品数量！");
		return false;
		}
	    
	return true;
	}
-->
</script>
<%

if(session.getAttribute("id").toString().isEmpty()){
  		response.sendRedirect("../login.jsp");
}

OrderDeal Or= new OrderDeal();
String BuyerID=(String)session.getAttribute("id");
String ComID=request.getParameter("ComID");
session.setAttribute("ComID",ComID); 

String SellerID=Or.CalSellerID(ComID);
session.setAttribute("SellerID",SellerID);
 
String ComName=Or.CalComName(ComID);
session.setAttribute("ComName",ComName); 
%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>订单填写</title>
<link href="../css/order.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper_first">
  <p class="title_first">当前位置 ： 东师格子铺 -----订单填写 </p>
</div>
<div class="order_pic"><img src="../images/dingdan_03.png" />
</div>
<form name="form1" method="POST" action="OrderJump.jsp"
	onSubmit="return checkForm()">

	<%
			Object errorMsg = request.getAttribute("result");
			OrderDeal order = (OrderDeal) request.getAttribute("order");
			if (errorMsg != null) {
	%>
	<table>
	<tr>
		<td colspan="2" align=center height="32"><font size="4" color="red"><b>填写失败：<%=errorMsg.toString()%></b></font></td>
		</tr></table>
	<%}
	%>
  <div>
<ul class="order_word">
  <li style="padding:10px">卖家：<%=SellerID%> </li>
  <li style="padding:10px">买家：<%=BuyerID%> </li>
  <li style="padding:10px">商品编号：<%=ComID%></li>    
        <li style="padding:10px">商品名称：<%=ComName%></li>
        <li style="padding:10px">订购数量：
              <input type="text" name="OrderNum" id="shuliang" >
        </li>
        <li style="padding:10px">有效期：<%=2%></li>
        <li style="padding:10px">备注：
              <textarea name="OrderInf" id="beizhu" cols="45" rows="5"></textarea>
        </li>
        <li></li>
 </ul>
</div>
<div class="pic"></div>
<div class="tijiao2"> <input name="submit" type="submit" class="submit_tijiao" value=""/></div>
<div class="tijiao3"> <input name="reset" type="reset" class="submit_tijiao3" value=""/></div></form>
</body>

</html>
